Byte3IO
 
Component Byte3IO
General Three-Bytes Input/Output
Component Level: High
Typical Usage:
(Examples of a typical usage of the component in user code. For more information please see the page Component Code Typical Usage.)

Required component name is "Bt31".
Some examples of typical usage of this component are the following:

(1)
The direction of the component is set to input.

 MAIN.C

void main(void)
{
  /* Wait until "10101010" is on the low port,
     "01010101" is on the middle port and 
     "00010001" is on the high port */
  while( Bt31_GetVal() != 0x1155AA );
    :
}

(2)
The direction of the component is set to output.

 MAIN.C

void main(void)
{
  Bt31_PutVal(0x1155AA);
  /* "10101010" is on the low port,
     "01010101" is on the middle port and 
     "00010001" is on the high port */
  
  for (;;) {
  /* Invert output level of second pin on the high port */
    Bt31_NegBit(17);
  }
}

(3)
The direction of the component is set to input/output.

 MAIN.C

void main(void)
{
  Bt31_SetDir(FALSE);  // Set input mode

  /* Wait until "0xFFFFFF" is on the ports */
  while( Bt31_GetVal() != 0xFFFFFF );
  
  Bt31_SetDir(TRUE);   // Set output mode

  Bt31_PutVal(0);      // Set "0x000000" on the ports
}